package cn.xz.mxxz.adapter

import android.graphics.Color
import android.widget.ImageView
import android.widget.TextView
import cn.xz.mxxz.R
import cn.xz.mxxz.bean.AreaList
import cn.xz.mxxz.bean.DreamTitle
import cn.xz.mxxz.bean.LeaderData
import cn.xz.mxxz.util.AppHelper
import cn.xz.mxxz.widgets.XZTextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 *历史气泡适配器*/
class DialogAdapter: BaseQuickAdapter<LeaderData, BaseViewHolder>(R.layout.item_dialog) {

    override fun convert(holder: BaseViewHolder, item: LeaderData) {

        val tvYear = holder.getView<TextView>(R.id.tv_year)

        tvYear.text = item.name

        var mD = AppHelper.getDrawable(R.drawable.bg_dialog_s_1)
        var mC = "#548BF7"
        if (!item.select){
            mD =  AppHelper.getDrawable(R.drawable.bg_dialog_s)
            mC = "#000000"
        }

        tvYear.setTextColor(Color.parseColor(mC))
        holder.itemView.background = mD
    }
}